<?php

namespace Modules\Common\General\Notification\SystemError;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Modules\Common\Models\SystemError;

class SystemErrorMail extends Mailable
{
    use Queueable, SerializesModels;

    protected $systemError;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct(SystemError $systemError)
    {
        $this->systemError = $systemError;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->subject('系统异常：' . $this->systemError->title)->view('system-error')->with(['error' => $this->systemError]);
    }
}
